<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        /*选中第一层子级*/
        .con>a {
            color: red;
        }


        /*同级后面第一个*/
        .con+a {
            color: blue;
        }

        /*同级后面所有的*/
        .con~a {
            font-size: 30px;
        }


    </style>
</head>


<body>


    <div class="con">
        <a href="">a1</a>

        <p>p1</p>
        <div>
            <a href="">a2</a>
            <a href="">a3</a>
        </div>

        <a href="">a4</a>
    </div>

    <a href="">a5</a>
    <a href="">a6</a>
    <p>hahahah</p>
    <a href="">a8</a>
    <a href="">a9</a>



</body>

</html>